package com.dingxin.ship_together_api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dingxin.ship_together_api.entity.SysMenu;
import com.dingxin.ship_together_api.entity.SysRole;
import com.dingxin.ship_together_api.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;

import javax.management.relation.Role;
import java.util.List;

/**
 * Author: ctj
 * Date: 2022-08-09
 * Time: 10:55
 */

@Mapper public interface SysUserMapper extends BaseMapper<SysUser> {

    /**
     * 根据用户id查询用户角色
     * @param loginId
     * @return
     */
    List<SysRole> selectRolesByUserId(Object loginId);

    /**
     * 根据用户id查询用户权限
     * @param loginId
     * @return
     */
    List<SysMenu> selectPermissionsByUserId(Object loginId);

    /**
     * 获取系统所有角色
     * @return
     */
    List<SysRole> selectAllRole();

    /**
     * 根据角色代码查询角色权限
     * @param roleCode
     * @return
     */
    List<SysMenu> selectPermissionsByRoleCode(String roleCode);
}